<template>
  <div class="bargain_list">
    <headers>
      <span slot="title">砍价列表</span>
    </headers>
    <div class="bargain_list_details"> <van-card  v-for="item in bargainlist" :key="item.id" :num="'库存：'+item.numberOrders"
      :price="item.kanjiaPrice" :desc="item.characteristic" :title="item.name" :thumb="item.pic" tag="热销"
      :origin-price="item.numberSells" 
      
     @click="gotobargain_list_details(item.id)"
      />
</div>

  </div>
</template>

<script>
import headers from '../../components/headers.vue'
export default {
  components: { headers },
  data() {
    return {
      bargainlist : []
    }
  },

  methods: {

    gotobargain_list_details(id){
      this.$router.push({path:this.$path.BARGAIN_LIST_DETAILS,query:{id}})
      // console.log(id);
    }
  },

  mounted() {
    this.$API.bargain_list().then((res) => {
        // console.log(res);
        this.bargainlist = res.data.data.goodsMap
        // console.log(this.bargainlist);
      }).catch((err) => {
        console.log(err);
      });
  },
}
</script>

<style lang="scss" scoped>
  .bargain_list{
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-flow: column;
    .bargain_list_details{
      flex: 1;
      overflow: scroll;
    }
  }
</style>